<template>
	<view>
		<view class="image-container"><image class="image" src="../../static/exception.png"></image></view>
		<view class="title"><text class="is-h2 title">{{title}}</text></view>
		<view class="title"><text class="is-h4 title">{{title2}}</text></view>
		<view class="title"><button type="default" @click="goHome()">主页</button></view>
		<!-- <view class="title"><text class="is-h2 title btn" @click="goHome()">主页</text></view> -->
	</view>
</template>

<script>
	export default {
		data() {
			return {
				code: 0,
				title: "未知错误",
				title2: "我也不知道怎么了。。。"
			};
		},
		methods:{
			goHome:function(){
				uni.navigateBack({
					delta:1
				});
			}
		},
		onLoad(option) {
			console.log(JSON.stringify(option))
			if (option.action === 404) {
				this.code = 404;
				this.title = "页面丢失了";
				this.title2 = "众里寻他千百度，默认回首。。。丢了。。。";

			} else if (option.action === 500) {
				this.code = 404;
				this.title = "发生错误了";
				this.title2 = "子曰：谁能无错，错了就该！！！";

			} else if (option.action === 403) {
				this.code = 404;
				this.title = "没有权限";
				this.title2 = "权利越大，责任越大！！！";

			} else {

				this.code = 0;
				this.title = "未知错误";
				this.title2 = "我也不知道怎么了。。。";
			}
		}
	}
</script>

<style scoped>
	.image-container {
		width: 100%;
		text-align: center;
		display: flex;
		justify-content: center;
		flex-direction: row;
	}
	.image {
		width: 50%;
	}
	.title{
		width: 100%;
		text-align: center;
		margin-bottom: 40upx;
		color: #000000;
	}
	.btn{
		color: #007AFF;
	}
	
</style>
